// Learn cc.Class:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html
//  - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
//  - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
//  - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html

cc.Class({
    extends: cc.Component,

    properties: {
        speed: 2000,
        isFireMode: false
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {

    },
    

    update (dt) {
        var s = dt * this.speed
        this.node.y += s

        // 当子弹飞出屏幕时，要删除
        if (this.node.y >= cc.winSize.height / 2) {
            this.node.removeFromParent()
        }
    },
});
